
id_card = "110101199003074512"


address_code = id_card[0:6]
print("1. 地址码：", address_code)

birth_year_pos = id_card[6:10]

birth_year_neg = id_card[-12:-8]
print("2. 出生年（正索引）：", birth_year_pos)
print("   出生年（负索引）：", birth_year_neg)

birth_month = id_card[10:12]  
birth_day = id_card[12:14]   
print("3. 出生年月：{} 年 {} 月 {} 日".format(birth_year_pos, birth_month, birth_day))

gender_code = int(id_card[16])  
gender = "男性" if gender_code % 2 == 1 else "女性"
print("4. 性别：", gender)